package myPack.GMAO.Entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;


@Entity
public class Equipement implements Serializable
{
	@Id
	private String ref;
    private String lebel;
    private Date dateA;
    private String mrq;
    private float prixA;
    private Date dateFG;
    private String fichPDF;
    private String img;
    private String des;
    private String desg;
    private Date dateMS;
    private boolean traiter;
    private boolean instaler;
    private Date dateFS;
    private int tauxH=0;
    
    @ManyToOne @JoinColumn(name="idB")
    private Batiment batiment;
    
    @ManyToOne @JoinColumn(name="idS")
    private Service service;
    
    @ManyToOne @JoinColumn(name="idF")
    private Famille famille;

    @ManyToOne @JoinColumn(name="mat")
    private Fornisseur mFornisseur;
    
    @OneToMany(mappedBy="mEquipement")
    private List<Contrat> lstC;

    @OneToMany @JoinColumn(name="ref")
    private List<BMP> lstBMP;
    
    public Equipement () {
    }

	public Equipement(String ref, String lebel, Date dateA, String mrq,
			float prixA, Date dateFG, String fichPDF, String img, String des,
			Date dateMS, boolean traiter, boolean instaler, Date dateFS,
			Batiment batiment, Service service, Famille famille,
			Fornisseur mFornisseur, List<Contrat> lstC, List<BMP> lstBMP) {
		super();
		this.ref = ref;
		this.lebel = lebel;
		this.dateA = dateA;
		this.mrq = mrq;
		this.prixA = prixA;
		this.dateFG = dateFG;
		this.fichPDF = fichPDF;
		this.img = img;
		this.des = des;
		this.dateMS = dateMS;
		this.traiter = traiter;
		this.instaler = instaler;
		this.dateFS = dateFS;
		this.batiment = batiment;
		this.service = service;
		this.famille = famille;
		this.mFornisseur = mFornisseur;
		this.lstC = lstC;
		this.lstBMP = lstBMP;
	}

	public Equipement(String ref, String lebel, Date dateA,String mrq, float prixA,Date dateFG, String fichPDF, String des,Famille famille, Fornisseur mFornisseur) 
	{
		this.ref = ref;
		this.lebel = lebel;
		this.dateA = dateA;
		this.mrq=mrq;
		this.prixA = prixA;
		this.dateFG = dateFG;
		this.fichPDF = fichPDF;
		this.des = des;
		this.famille = famille;
		this.mFornisseur = mFornisseur;
		this.traiter=false;
		this.instaler=false;
		
	}
	public Equipement(String ref, String img, String desg, Date dateMS,
			boolean instaler, Date dateFS, int tauxH, Batiment batiment,
			Service service) {
		super();
		this.ref = ref;
		this.img = img;
		this.desg = desg;
		this.dateMS = dateMS;
		this.instaler = instaler;
		this.dateFS = dateFS;
		this.tauxH = tauxH;
		this.batiment = batiment;
		this.service = service;
	}

	public String getDesg() {
		return desg;
	}

	public void setDesg(String desg) {
		this.desg = desg;
	}

	public String getRef() {
		return ref;
	}

	public void setRef(String ref) {
		this.ref = ref;
	}

	public String getLebel() {
		return lebel;
	}

	public void setLebel(String lebel) {
		this.lebel = lebel;
	}

	public Date getDateA() {
		return dateA;
	}

	public void setDateA(Date dateA) {
		this.dateA = dateA;
	}

	public String getMrq() {
		return mrq;
	}

	public void setMrq(String mrq) {
		this.mrq = mrq;
	}

	public float getPrixA() {
		return prixA;
	}

	public void setPrixA(float prixA) {
		this.prixA = prixA;
	}

	public Date getDateFG() {
		return dateFG;
	}

	public void setDateFG(Date dateFG) {
		this.dateFG = dateFG;
	}

	public String getFichPDF() {
		return fichPDF;
	}

	public void setFichPDF(String fichPDF) {
		this.fichPDF = fichPDF;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public String getDes() {
		return des;
	}

	public void setDes(String des) {
		this.des = des;
	}

	public Date getDateMS() {
		return dateMS;
	}

	public void setDateMS(Date dateMS) {
		this.dateMS = dateMS;
	}

	public boolean isTraiter() {
		return traiter;
	}

	public boolean isInstaler() {
		return instaler;
	}

	public void setInstaler(boolean instaler) {
		this.instaler = instaler;
	}

	public void setTraiter(boolean traiter) {
		this.traiter = traiter;
	}

	public Date getDateFS() {
		return dateFS;
	}

	public void setDateFS(Date dateFS) {
		this.dateFS = dateFS;
	}

	public Batiment getBatiment() {
		return batiment;
	}

	public void setBatiment(Batiment batiment) {
		this.batiment = batiment;
	}

	public Service getService() {
		return service;
	}

	public void setService(Service service) {
		this.service = service;
	}

	public Famille getFamille() {
		return famille;
	}

	public void setFamille(Famille famille) {
		this.famille = famille;
	}

	public Fornisseur getmFornisseur() {
		return mFornisseur;
	}

	public void setmFornisseur(Fornisseur mFornisseur) {
		this.mFornisseur = mFornisseur;
	}

	public List<Contrat> getLstC() {
		return lstC;
	}

	public void setLstC(List<Contrat> lstC) {
		this.lstC = lstC;
	}

	public List<BMP> getLstBMP() {
		return lstBMP;
	}

	public void setLstBMP(List<BMP> lstBMP) {
		this.lstBMP = lstBMP;
	}

	public int getTauxH() {
		return tauxH;
	}

	public void setTauxH(int tauxH) {
		this.tauxH = tauxH;
	}
	
	
}

